#ifndef _INC_RAYTRACER_STRUCTURES_11
#define _INC_RAYTRACER_STRUCTURES_11


#define NO_INTERCEPT -1
#define ZERO_APPROX 0.00001

//Lighting
#define AMBIENT_LIGHT 0.05//0.05
#define SPECULAR_FACTOR 0.4
#define SPECULAR_POWER 2
#define DIFFUSE_FACTOR 0.4
#define ATTENUATION_FACTOR 0.4


struct Point3{
	double x;
	double y;
	double z;

	Point3(double a, double b, double c) 
	{
		x = a;
		y = b;
		z = c;
	}

	Point3(){}
};

double dotPoints( Point3 p1, Point3 p2 );

void subtractPoints( Point3 p1, Point3 p2, Point3 * result );

void addPoints( Point3 p1, Point3 p2, Point3 * result ); 

void scalePoint( Point3 p1, double factor, Point3 * result );

void normalize( Point3 * point );

double eulideanDistance( Point3 p1, Point3 p2 );

void reflectVector( Point3 inVector, Point3 normal, Point3 * outVector );

double lightEquation( Point3 inVector, Point3 surfaceLoc, Point3 normal, Point3 lightLoc );

struct Color4{
	double red;
	double green;
	double blue;
    double alpha;

	Color4(double r, double g, double b, double a) 
	{
	    red = r;
	    green = g;
	    blue = b;
        alpha = a;
	}

	Color4(){}
};

Color4 addColors( Color4 * colors, double * colorPercents, int countColors);

void addTwoColors( Color4 color, Color4 * myColor);

Color4 multiplyColors( Color4 color1, Color4 color2, double scalar);

struct Color3{
	float red;
	float green;
	float blue;

	Color3(double r, double g, double b) 
	{
	    red = r;
	    green = g;
	    blue = b;
	}

	Color3(){}
};

#endif